﻿/*************************************************************************
 *
 *    GNU Lesser General Public License Version 2.1
 *    =============================================
 *    Copyright 2005 by Sun Microsystems, Inc.
 *    901 San Antonio Road, Palo Alto, CA 94303, USA
 *
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License version 2.1, as published by the Free Software Foundation.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 *
 *    You should have received a copy of the GNU Lesser General Public
 *    License along with this library; if not, write to the Free Software
 *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
 *    MA  02111-1307  USA
 *
 ************************************************************************/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Newtonsoft.Json;

namespace CatchUpTv.Downloader.Australia.AbcIView
{
    /// <summary>
    /// An object for deserializing a series episode from iView's json.
    /// </summary>
    /// <remarks>Sample json: {"a":"654437","b":"Arthur Series 1 Episode 4","c":"D.W's Imaginary Friend\/Arthur's Lost Library Book","d":"Arthur, an 8-year-old aardvark, guides us through energetic, emotional stories about growing up. His world revolves around his family and friends and he lives in a town peopled by odd and engaging animals.","e":"ABC For Kids","f":"2010-10-20 16:05:00","g":"2010-11-03 16:05:00","h":"2010-10-22 00:00:00","i":"125","j":"1500","m":"G","n":"kids\/arthur_10_01_04.mp4","s":"http:\/\/www.abc.net.au\/reslib\/201010\/r654525_4631688.jpg","t":false}</remarks>
    [JsonObject]
    public class SeriesEpisode
    {
        /// <summary>
        /// The Id for the episode.
        /// </summary>
        [JsonProperty(PropertyName = "a")]
        public int Id { get; set; }

        /// <summary>
        /// The name of the episode.
        /// </summary>
        [JsonProperty(PropertyName = "b")]
        public string Title { get; set; }

        /// <summary>
        /// The name of the episode.
        /// </summary>
        [JsonProperty(PropertyName = "c")]
        public string Name { get; set; }

        /// <summary>
        /// The description for the episode.
        /// </summary>
        [JsonProperty(PropertyName = "d")]
        public string Description { get; set; }

        /// <summary>
        /// The date the episode was added.
        /// </summary>
        [JsonProperty(PropertyName = "h")]
        public DateTime Added { get; set; }

        /// <summary>
        /// The date the episode expires.
        /// </summary>
        [JsonProperty(PropertyName = "g")]
        public DateTime Expires { get; set; }

        /// <summary>
        /// The episode's file size.
        /// </summary>
        [JsonProperty(PropertyName = "i")]
        public double FileSize { get; set; }

        /// <summary>
        /// The episode's duration.
        /// </summary>
        [JsonProperty(PropertyName = "j")]
        public int Duration { get; set; }

        /// <summary>
        /// The episode's rating.
        /// </summary>
        [JsonProperty(PropertyName = "m")]
        public string Rating { get; set; }

        /// <summary>
        /// The episode's file.
        /// </summary>
        [JsonProperty(PropertyName = "n")]
        public string File { get; set; }

        /// <summary>
        /// The episode's image URL.
        /// </summary>
        [JsonProperty(PropertyName = "s")]
        public string ImageUrl { get; set; }

        /// <summary>
        /// Are captions available.
        /// </summary>
        [JsonProperty(PropertyName = "t")]
        public bool CaptionsAvailable { get; set; }
    }
}